package com.joysuch.wwyt.bp.repository;

import com.joysuch.wwyt.bp.entity.investigate.BpInvestigateConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BpInvestigateConfigDao extends JpaRepository<BpInvestigateConfig, Long> {

    @Query(value = "update wwyt_bp_investigate_config set status = ?2 where id = ?1",nativeQuery = true)
    @Modifying
    int updateById(Long id,String status);

    List<BpInvestigateConfig> findAll();

    @Query(value = "select status from wwyt_bp_investigate_config where config_name = ?1", nativeQuery = true)
    String findStatusByName(String name);
}
